#******************************************************************************#
#                         Class  : ExampleModule                               #
#******************************************************************************#
package ExampleModule;

#use strict;

#"my" defines a private variable, which can be used ONLY in current package scope.
#It can't be used in other files.
my $myVar = 100; 

#"local" does NOT define a new variable. It only store the global var and use a temp
#value inside current scope. When out of this scope, it restores original global value.
local $localVar = 200;

#"our" defines a global variable (package's symbol table record such variables), and can
#be used in other packages, or files.
our $ourVar = 300;

#By defaults, it means global variables.
$globalVar = 400;

sub printPgSymbol
{
	while ( my ( $key, $value ) = each(%ExampleModule::) )
	{

		# Look at the symbol table of this package
		print "$key:\t\t$value\n";
	}
}

sub printMyVar()
{
	print "----------------------------\n" ;
	print "myVar = $myVar\n";
	print "----------------------------\n" ;
}